#include <iostream>
#include <stdexcept>
using std::runtime_error;
using std::cout;
using std::cin;

void f3() throw (runtime_error)
{
	cout<<"f3 a fost apelata din f2\n";
	throw runtime_error("f3 make error");
}
void f2() throw (runtime_error)
{
	cout<<"f2 a fost apelata din f1\n";
	f3();
}

void f1() throw (runtime_error)
{
	cout<<"f1 a fost apelata\n";
	f2();
}
int main()
{
	try
	{
		cout<<"Main";
		f1();
	}
	catch(runtime_error &error){
		cout<<"\nAm prins eroarea "<<error.what();
	}

	return 0;
}
